<div class="panel panel-info">
	<div class="panel-heading">
		<%= link_to edit_task_path(task) do %>
		Created <%= time_ago_in_words(task.created_at)%> ago
		<% end %>
		<%= link_to "x", task_path(task), method: :delete, data: {confirm: "您确定吗?"}, class: "pull-right" %>
	</div><!--end of panel-heading-->
	<div class="panel-body"><%=task.content%></div>
	<div class="panel-footer text-center">
		<% if task.state == "doing"%>
		<div class="btn-group btn-group-justified">
			<%= link_to "<i class='fa fa-arrow-left'></i>".html_safe, change_task_path(task, state: "to_do"), method: :put, class: "btn btn-info btn-md btn-block"%>
			<%= link_to "<i class='fa fa-arrow-right'></i>".html_safe, change_task_path(task, state: "done"), method: :put, class: "btn btn-info btn-md btn-block"%>
		</div>
		<% elsif task.state == "done"%>
		<%= link_to "<i class='fa fa-arrow-left'></i>".html_safe,  change_task_path(task, state: "doing"), method: :put, class: "btn btn-info btn-md btn-block"%>
		<% else %>
		<%= link_to "<i class='fa fa-arrow-right'></i>".html_safe,
		change_task_path(task, state: "doing"), method: :put, class: "btn btn-info btn-md btn-block"%>
		<%end%>
	</div>
</div>

